#include <iostream>
using namespace std;

class base {
public:
	virtual void f1() {
		cout << "base::f1" << endl;
	}
	virtual void f2() {
		cout << "base::f2" << endl;
	}
};

class derived : public base {
public:
	virtual void f1() override {
		cout << "derived::f1" << endl;
	}
	virtual void f2() override {
		cout << "derived::f2" << endl;
	}
};
using f_t = void(*)();
int main() {
	derived b;
	f_t* vptr = *(f_t**)(&b);
	for (int i = 0; vptr[i]; ++i) {
		vptr[i]();
	}
	return 0;
}